package com.tyk.bookstore.front.system.controller;

import com.tyk.bookstore.front.common.core.model.result.R;
import com.tyk.bookstore.front.system.model.vo.AreaVo;
import com.tyk.bookstore.front.system.service.AreaService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author tyk
 * @description 行政区域管理
 */
@RequestMapping({"api/platform/area"})
@Tag(name = "平台管理/行政区域管理", description = "行政区域管理")
@RestController
@RequiredArgsConstructor
public class AreaController {
    private final AreaService areaService;

    @GetMapping({"tree"})
    @Operation(summary = "查询行政划分树", description = "查询行政划分树")
    public R<List<AreaVo>> getAreaTree() {
        return R.ok(areaService.getAreaTree());
    }

}
